package GJ;

public class ArrayList <T> {
    private Object[] listElem;
    private int curLen;
    public int size = 0;
    private int maxSize;

    public ArrayList(int maxSize){
        this.maxSize = maxSize;
        curLen =0;
        listElem = new Object[maxSize];
    }

    public ArrayList(){
        curLen = 0;
        listElem = new Object[100];
    }

    public void clear(){
        listElem = new Object[maxSize];
        size = 0;
        curLen = 0;
    }

    public int length(){
        return curLen;
    }

   public String get(int i){
        return (String) listElem[i];
   }

   public  int getInt(int i){
        return (int) listElem[i];
   }

    public void addBooks(String Books){
        listElem[size++]=Books;
        curLen++;
    }


}
